Skip to content

[Qt5 C++] Actually use the model name prefix in the Qt5 generator#3981

Merged
wing328 merged 2 commits into
swagger-api:2.3.0from
Ragnis:fix-model-name-prefix
Oct 19, 2016
Merged

[Qt5 C++] Actually use the model name prefix in the Qt5 generator#3981
wing328 merged 2 commits into
swagger-api:2.3.0from
Ragnis:fix-model-name-prefix

Conversation

@Ragnis

@Ragnis Ragnis commented Oct 13, 2016

Copy link
Copy Markdown

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

Actually use the model name prefix, if one has been specified.

@Ragnis Ragnis changed the base branch from master to 2.3.0 October 13, 2016 08:45
@Ragnis Ragnis changed the title Actually use the model name prefix in the Qt5 generator [Qt5 C++] Actually use the model name prefix in the Qt5 generator Oct 13, 2016
@fehguy

fehguy commented Oct 13, 2016

Copy link
Copy Markdown
Contributor

@Ragnis can you specify what version of the QT framework you're testing with? Some recent changes seem to have broken support for 5.3.x, and I think it'd be wise for us to declare what version the templates support.

@Ragnis

Ragnis commented Oct 15, 2016

Copy link
Copy Markdown
Author

I use Qt 5.7, but for this specific PR it shouldn't really matter.

@wing328

wing328 commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

@Ragnis thanks for the PR. When I tried to compile the Petstore project, I got the following error:

In file included from ../PetStore/main.cpp:2:
In file included from ../PetStore/PetApiTests.h:7:
../PetStore/../client/SWGPetApi.h:30:10: fatal error: 'SWGPet.h' file not found
#include "SWGPet.h"
         ^
1 error generated.
make: *** [main.o] Error 1
15:52:46: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project PetStore (kit: Desktop Qt 5.7.0 clang 64bit)
When executing step "Make"
15:52:46: Elapsed time: 00:01.

Did the project compile and the tests pass for you locally in your machine?

@Ragnis

Ragnis commented Oct 19, 2016

Copy link
Copy Markdown
Author

Are you sure you were on the correct and up-to-date branch (the branch has been rebased multiple times, this might cause problems when checking it out)?

@wing328

wing328 commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

I did the following early:

git checkout -b Ragnis-fix-model-name-prefix 2.3.0
git pull https://github.com/Ragnis/swagger-codegen.git fix-model-name-prefix

Later I'll give it another try using your repo directly.

@wing328

wing328 commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

I cloned your repo directly and tests ran fine.

Totals: 6 passed, 0 failed, 0 skipped, 0 blacklisted, 7642ms

Thanks for the contribution.

@wing328 wing328 merged commit c73e499 into swagger-api:2.3.0 Oct 19, 2016
@wing328 wing328 modified the milestones: v2.3.0, v2.2.2 Oct 19, 2016
@wing328

wing328 commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

Upgrade note

Model prefix was set to "SWG" before. Starting at version 2.3.0, model prefix will be set to modelNamePrefix (default to empty string) obtained via the configuration.

To keep "SWG" as the prefix, just set modelNamePrefix to "SWG" when generating the qt5cpp client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants